package com.example.mylibrary.activity;

import android.app.Activity;
import android.support.v4.app.Fragment;


/**
 * Created by fairplay on 2018/5/31.
 */

public abstract class BaseFragment extends Fragment {
    protected Activity mActivity;

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        mActivity = activity;
    }

    /**
     * 通过资源ID来实例化视图对象
     */
    protected abstract void findViews();

    /**
     * 初始化new出来的对象
     */
    protected abstract void initObjects();

    /**
     * 初始化视图状态
     */
    protected abstract void initViews();

    /**
     * 初始化数据
     */
    protected abstract void initData();

    /**
     * 为视图设置监听
     */
    protected abstract void setListeners();
}
